<template>
  <div class="main-box">
    <el-drawer
      :visible.sync="isDrawer"
      :direction="direction"
      size="400px"
      :with-header="false"
    >
      <div class="head-box">
        <div class="identifier-box"></div>
        <div>日报信息</div>
        <div class="iconfont icon-guanbi" @click="isDrawer = false"></div>
      </div>
      <div class="info-box">
        <div class="left-box">
          <div>提交人：</div>
          <div>填写日期：</div>
          <div>项目编号：</div>
          <div>工作类型：</div>
          <div class="work-detail">今日已完成：</div>
          <div class="work-detail">今日未完成：</div>
          <div class="work-detail">明日计划：</div>
        </div>
        <div class="right-box">
          <div>{{ dailyInfoRow.creator }}</div>
          <div>
            {{
              dailyInfoRow.createtime
                ? dailyInfoRow.createtime.split("T")[0]
                : ""
            }}
          </div>
          <div>{{ dailyInfoRow.procode }}</div>
          <div>{{ dailyInfoRow.worktype }}</div>
          <div class="work-detail">{{ dailyInfoRow.workcontent }}</div>
          <div class="work-detail">{{ dailyInfoRow.unfinishworktoday }}</div>
          <div class="work-detail">{{ dailyInfoRow.planworktomorrow }}</div>
        </div>
      </div>
    </el-drawer>
  </div>
</template>

<script>
export default {
  props: {
    drawer: {
      type: Boolean,
      default: false,
    },
    dailyInfoRow: {
      type: Object,
      default: null,
    },
  },
  data() {
    return {
      // 是否弹出抽屉
      isDrawer: false,
      // 抽屉弹出方向
      direction: "rtl",
      // 项目名称
      proName: "",
    };
  },

  mounted() {},

  methods: {
    openDrawer(row) {
      this.proName = row.proshortname;
      this.isDrawer = true;
    },
  },
};
</script>

<style lang="scss" scoped>
.main-box {
  .drawer-title {
    font-size: 16px;
  }
  .head-box {
    border-bottom: 1px solid #dddcdc;
    height: 30px;
    width: 432px;
    padding-right: 40px;
    line-height: 30px;
    text-align: start;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 10px;
    padding-left: 20px;
    display: flex;
    align-items: center;

    .identifier-box {
      height: 10px;
      width: 5px;
      margin-right: 6px;
      background: #11a70c;
    }

    .icon-guanbi {
      margin-left: 73%;
    }
    .icon-guanbi:hover {
      cursor: pointer;
    }
  }

  .info-box {
    /* border: 1px solid red; */
    width: 100%;
    padding-left: 8%;
    display: flex;

    .left-box {
      width: 100px;
      text-align: end;
    }

    .right-box {
      width: 60%;

      > div {
        text-align: start;
      }
    }

    .left-box,
    .right-box {
      /* border: 1px solid blue; */

      > div {
        /* border: 1px solid blue; */
        height: 30px;
        width: 100%;
        line-height: 30px;
        font-size: 14px;
        margin: 5px 0;

        > input {
          padding-left: 15px;
          width: 92%;
          height: 20px;
          border: 1px solid #c8ccce;
          border-radius: 4px;
        }

        .el-select {
          width: 100%;
        }

        .el-cascader {
          width: 100%;
        }
      }

      .work-detail {
        max-height: 90px;
        line-height: 20px;
      }
    }
  }
}
</style>